package com.ccc.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ccc.dao.StorageDao;
import com.ccc.model.Storage;
import com.ccc.util.dao.UtilDao;

@Component("storageDao")
public class StorageDaoImpl implements StorageDao {
	
	@Resource
	private UtilDao utilDao;

	@Override
	public void addStorage(Storage storage) {
		utilDao.save(storage);
	}

	@Override
	public void deleteStorage(Storage storage) {
		utilDao.delete(storage);
	}

	@Override
	public void updateStorage(Storage storage) {
		utilDao.update(storage);
	}

	@Override
	public Storage findStorage(int id) {
		return utilDao.find(Storage.class, id);
	}

	@Override
	public List<Storage> findStorage(String hql, Object[] o) {
		return utilDao.find(hql, o);
	}

}
